package com.mgkj.dto.yf;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mgkj.dto.KWAndNum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * @author : ssy
 * @date: 2024-02-28
 * @Description:
 */
@Data
@Api(tags = "进货单单身Dto")
public class InitPURTHDto implements Serializable {

    @ApiModelProperty(value = "单别")
    @NotBlank(message = "单别不能为空")
    @JsonProperty("TH001")
    private String TH001;

    @ApiModelProperty(value = "单号")
    @NotBlank(message = "单号不能为空")
    @JsonProperty("TH002")
    private String TH002;

    @ApiModelProperty(value = "序号")
    @NotBlank(message = "序号不能为空")
    @JsonProperty("TH003")
    private String TH003;

    @ApiModelProperty(value = "品号",required = true)
    @NotBlank(message = "品号不能为空")
    @JsonProperty("TH004")
    private String TH004;

    @ApiModelProperty(value = "进货数量",required = true)
    @DecimalMin(value = "0.01",message = "不许小于0/进货数=验收数+验退数+破坏数+报废数")
    @JsonProperty("TH007")
    private Double TH007;


    @ApiModelProperty(value = "单位", required = true)
    @NotEmpty(message = "单位不能为空")
    @JsonProperty("TH008")
    private String TH008;

    @ApiModelProperty(value = "仓库", required = true)
    @NotBlank(message = "仓库不能为空")
    @JsonProperty("TH009")
    private String TH009;

    @ApiModelProperty(value = "批号")
    @JsonProperty("TH010")
    private String TH010;

    @ApiModelProperty(value = "采购单别",required = true)
    @NotBlank(message = "采购单别不能为空")
    @JsonProperty("TH011")
    private String TH011;

    @ApiModelProperty(value = "采购单号",required = true)
    @NotBlank(message = "采购单号不能为空")
    @JsonProperty("TH012")
    private String TH012;

    @ApiModelProperty(value = "采购序号",required = true)
    @NotBlank(message = "采购序号不能为空")
    @JsonProperty("TH013")
    private String TH013;


    @ApiModelProperty(value = "到货单别",required = true)
    @NotBlank(message = "到货单别不能为空")
    @JsonProperty("THC03")
    private String THC03;

    @ApiModelProperty(value = "到货单号",required = true)
    @NotBlank(message = "到货单号不能为空")
    @JsonProperty("THC04")
    private String THC04;

    @ApiModelProperty(value = "到货序号",required = true)
    @NotBlank(message = "到货序号不能为空")
    @JsonProperty("THC05")
    private String THC05;

    @ApiModelProperty(value = "检验批次",required = true)
    @NotBlank(message = "检验批次不能为空")
    @JsonProperty("THC06")
    private String THC06;

    @ApiModelProperty(value = "验收日期")
    @NotBlank(message = "签收日期不能为空")
    @JsonProperty("TH014")
    private String TH014;


    @ApiModelProperty(value = "验收数量",required = true)
    @DecimalMin(value = "0.01",message = "不许小于0")
    @JsonProperty("TH015")
    private Double TH015;

    @ApiModelProperty(value = "计价数量",required = true)
    @DecimalMin(value = "0.01",message = "不许小于0/验收数量=计价数量")
    @JsonProperty("TH016")
    private Double TH016;

    @ApiModelProperty(value = "检验状态",required = true)
    @NotBlank(message = "检验状态不能为空/0.免检、1.待验、2.合格、3.不良、4.特采")
    @JsonProperty("TH028")
    private String TH028;

    @ApiModelProperty(value = "审核码",required = true)
    @Pattern(regexp = "^[NY]$",message = "只允许输入N|Y")
    @JsonProperty("TH030")
    private String TH030;

    @ApiModelProperty(value = "备注")
    @JsonProperty("TH033 ")
    private String TH033 ;

    @ApiModelProperty(value = "库位和对应的验收数量")
    private List<KWAndNum> kwInfo;

    @ApiModelProperty(value = "库位(后端用，前端不用传)")
    @JsonIgnore
    private String TH072 ="";

    private String creator;
    private String company;
    private String usrGroup;

}
